package com.ssy.lingxi.report.repository.report;

import com.ssy.lingxi.report.entity.report.OrderDayReportDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 订单日报表
 * @author 伍将
 * @date 2020/11/10
 * @version 2.0.0
 */
public interface OrderDayReportRepository extends JpaRepository<OrderDayReportDO, Long>, JpaSpecificationExecutor<OrderDayReportDO> {

    /**
     * 删除指定范围订单日报表
     * @author 伍将
     * @date 2020/11/9
     * @param startTime:
     * @param endTime:
     * @return void
     **/
    void deleteByDateTimeBetween(LocalDateTime startTime, LocalDateTime endTime);

    /**
     * 查询指定范围订单日统计数据
     * @author 伍将
     * @date 2020/11/10
     * @param startTime:
     * @param endTime:
     * @return java.util.List<com.ssy.lingxi.report.entity.report.OrderDayReportDO>
     **/
    List<OrderDayReportDO> getAllByDateTimeBetween(LocalDateTime startTime, LocalDateTime endTime);

    /**
     * 根据报表时间查询日报表
     * @author 伍将
     * @date 2021/1/14
     * @param time: 报表时间
     * @return 日报表
     **/
    OrderDayReportDO findFirstByDateTime(LocalDateTime time);
}

